#ifndef XPLAY_XTHREAD_H
#define XPLAY_XTHREAD_H

////haomiao
void XSleep(int mis);
///C++11 线程库
class XThread {
public:
    virtual bool Start();
    //通过控制isExit安全停止线程（不一定成功）
    virtual void Stop();
    virtual void SetPause(bool isP);
    virtual bool IsPause()
    {
        isPausing = isPause;
        return isPause;
    }
    ///入口主函数
    virtual void Main(){}

protected:
    bool isRuning = false;
    bool isExit = false; ///线程控制
    bool isPause = false;
    bool isPausing = false;
private:
    void ThreadMain();
};


#endif //XPLAY_XTHREAD_H
